<template>
  <div>
    <h2>同意</h2>
    {{ $store.state.user.token }}
    <br />
    {{ $store.state.setting.appName }}
    <br />
    <!-- <button @click="$store.commit('testUserMutations')">修改</button>
    <button @click="$store.dispatch('testSettingAction')">
      setting action
    </button> -->
    <!-- 空间锁状态下使用函数方法一 -->
    <!-- <button @click="$store.commit('user/testMutations')">触发user模块</button>
    <button @click="$store.commit('setting/testMutations')">
      触发setting模块
    </button> -->
    <button @click="testMutations">测试</button>
  </div>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  methods:{
    // 辅助函数有一个可选模块名参数
    // ...mapMutations('user',['testMutations'])
    ...mapMutations('setting',['testMutations'])
  }
};
</script>

<style>
</style>